package com.tsj.mvp.demo6;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.tsj.mvp.R;

/**
 * 该demo6将activity抽象出基类BaseMvpActivity
 * */
public class MainActivity6 extends BaseMvpActivity<LoginView6,LoginPresenter6> implements LoginView6 {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClickView(View view){
        getPresenter().login("123456","123456");
    }

    @Override
    public void onLoginResult(String result) {
        Toast.makeText(this,result,Toast.LENGTH_LONG).show();
    }

    @Override
    public LoginPresenter6 initPresenter() {
        return new LoginPresenter6();
    }

    @Override
    public LoginView6 initView() {
        return this;
    }
}